home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Burning & Media
/
GB-PVR 1.2.13
/
GBPVR10213.msi
/
Cabs.w1.cab
/
RichTextBulletedList.cs85
< prev
next >
Wrap
Text File
|
2007-01-06
|
1KB
|
36 lines
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.UI;
using System.Web.UI.WebControls;
//Code found at: http://dotnetslackers.com/articles/aspnet/A_Better_BulletedList.aspx
//Author: Todd Northrop : http://blogs.lotterypost.com/todd/
namespace gbweb
{
public class RichTextBulletedList : BulletedList
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htmlWriter = new HtmlTextWriter(sw);
String rendered;
base.Render(htmlWriter);
rendered = Regex.Replace(sb.ToString(), "(?<!<)<(?!<)", "<");
rendered = Regex.Replace(rendered, "(?<!>)>(?!>)", ">");
rendered = Regex.Replace(rendered, "(?<!")"(?!")", "\"");
rendered = rendered.Replace("<<", "<")
.Replace(">>", ">")
.Replace("""", """);
writer.Write(rendered);
}
}
}